import { FormSchema } from '/@/components/BasicForm/type/form';
import { getSaaSTenantNameList } from '/@/api/tenant-mgmt/enterprise-admin';
import { getAppOpt } from '/@/api/tenant-mgmt/enterpriseAppManagement/enterpriseAppManagement';

export const columns = [
  {
    title: '企业租户',
    dataIndex: 'tenantName',
  },
  {
    title: '订阅应用',
    dataIndex: 'appName',
  },
  {
    title: '主机记录',
    dataIndex: 'hostRecord',
  },
  {
    title: '记录类型',
    dataIndex: 'recordType',
  },
  {
    title: '值',
    dataIndex: 'recordValue',
  },
  {
    title: '证书过期时间',
    dataIndex: 'certificateExpireTime',
  },
  {
    title: '域名配置状态',
    dataIndex: 'confStatus',
  },
  {
    title: '操作',
    dataIndex: 'action',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'tenantCode',
    label: '企业',
    component: 'ApiSelect',
    colProps: {
      span: 5,
    },
    componentProps: {
      api: getSaaSTenantNameList,
      resultField: 'list',
      labelField: 'alias',
      valueField: 'code',
    },
  },
  {
    field: 'appId',
    label: '应用',
    component: 'ApiSelect',
    colProps: {
      span: 5,
    },
    componentProps: {
      api: getAppOpt,
      resultField: 'list',
      labelField: 'label',
      valueField: 'value',
    },
  },
];
